package com.codeOfDoom.Sets.Managers.HintManager
{
	import com.codeOfDoom.Sets.Managers.EffectsManager.EffectsManager;
	import com.codeOfDoom.Sets.Managers.SetsManager.SetsManager;
	
	import mx.collections.ArrayCollection;
	
	public class HintManager
	{
		public function HintManager()
		{
			
		}
		public static function findSet(visibleCards:ArrayCollection):void{
				
				for (var i:int =0;i<visibleCards.length;i++)
					for (var j:int = i+1;j<visibleCards.length;j++)
						for (var k:int = j+1;k<visibleCards.length;k++){
							//need to refactor. checking the same sets multiple times.
							//maybe put a list of all comboniations in a dictionary and check that?
							
							
							var checkSet:ArrayCollection = new ArrayCollection();
							checkSet.addItem(visibleCards.getItemAt(i));
							checkSet.addItem(visibleCards.getItemAt(j));
							checkSet.addItem(visibleCards.getItemAt(k));
							if (SetsManager.verify(checkSet)){
								EffectsManager.removeAllSelectedGlow(visibleCards);
								EffectsManager.addSelectedGlowToCollectionOfCard(checkSet);
								return;
							}			
						}	
			}

	}
}